<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
	<meta name="apple-mobile-web-app-capable" content="yes"/>
	<title>Accordion Tests</title>

	<script type="text/javascript" src="../../../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base','Carousel','PageIndicator']"></script>
	<script type="text/javascript" src="../../../../../dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true, mblAlwaysHideAddressBar: true"></script>
	<style type="text/css">
		@import "../../../themes/common/domButtons/DomButtonBlackRightArrow16.css";
		@import "../../../themes/common/domButtons/DomButtonWhiteDownArrow16.css";
		@import "../../../themes/common/dijit/dijit.css";
		html,body{
			height: 100%;
		}
		.myPane {
			background-image: -webkit-gradient(linear, left top, left bottom, from(#dcdcdc), to(#FFFFFF));
			font-family: Times New Roman, Helvetica;
			color: black;
		}
	</style>

	<script type="text/javascript">
		require([
			"dijit/registry",  // dijit.byId
			"doh/runner",	//doh functions
			"dojo/ready",
			"dojo/dom",
			"dojo/dom-attr",
			"dojox/mobile/parser",
			"dojox/mobile",
			"dojox/mobile/compat",
			"dojox/mobile/SwapView",
			"dojox/mobile/Carousel"
		], function(registry, runner, ready, dom, domAttr){
			ready(function(){
				doh.register("dojox.mobile.test.doh.CarouselTests", [
					function ariaControlsAttr_CarouselWithId(){
						var view = dom.byId("foo");
						var previousButton = view.children[0].children[0].children[0].children[0];
						var nextButton = view.children[0].children[0].children[0].children[1];
						runner.assertEqual("carousel1_pages", domAttr.get(previousButton, "aria-controls"));
						runner.assertEqual("carousel1_pages", domAttr.get(nextButton, "aria-controls"));
					},
					function ariaControlsAttr_CarouselWithoutId(){
						var view = dom.byId("bar");
						var previousButton = view.children[0].children[0].children[0].children[0];
						var nextButton = view.children[0].children[0].children[0].children[1];
						runner.assertEqual("dojox_mobile_Carousel_0_pages", domAttr.get(previousButton, "aria-controls"));
						runner.assertEqual("dojox_mobile_Carousel_0_pages", domAttr.get(nextButton, "aria-controls"));
					}
				]);
				runner.run();
			});
		})
	</script>

</head>
<body style="visibility:hidden;background-color:#6D6D6D">
	<div id="foo" data-dojo-type="dojox/mobile/View">
		<!--  A carousel with an id -->
		<div id="carousel1" data-dojo-type="dojox/mobile/Carousel"
			data-dojo-props='height:"150px", navButton:true, numVisible:2, title:"Category"'>

			<div data-dojo-type="dojox/mobile/SwapView">
				<div data-dojo-type="dojox/mobile/CarouselItem"
					data-dojo-props='src:"../../images/dish1.jpg", value:"dish1", headerText:"dish1"'></div>
				<div data-dojo-type="dojox/mobile/CarouselItem"
					data-dojo-props='src:"../../images/dish2.jpg", value:"dish2", headerText:"dish2"'></div>
			</div>

			<div data-dojo-type="dojox/mobile/SwapView">
				<div data-dojo-type="dojox/mobile/CarouselItem"
					data-dojo-props='src:"../../images/dish3.jpg", value:"dish3", headerText:"dish3"'></div>
				<div data-dojo-type="dojox/mobile/CarouselItem"
					data-dojo-props='src:"../../images/dish4.jpg", value:"dish4", headerText:"dish4"'></div>
			</div>

			<div data-dojo-type="dojox/mobile/SwapView" lazy="true">
				<div data-dojo-type="dojox/mobile/CarouselItem"
					data-dojo-props='src:"../../images/dish5.jpg", value:"dish5", headerText:"dish5"'></div>
				<div data-dojo-type="dojox/mobile/CarouselItem"
					data-dojo-props='src:"../../images/dish6.jpg", value:"dish6", headerText:"dish6"'></div>
			</div>
		</div>
	</div>
	<div id="bar" data-dojo-type="dojox/mobile/View">
		<!--  A carousel with no id -->
		<div data-dojo-type="dojox/mobile/Carousel"
			data-dojo-props='height:"150px", navButton:true, numVisible:2, title:"Category"'>

			<div data-dojo-type="dojox/mobile/SwapView">
				<div data-dojo-type="dojox/mobile/CarouselItem"
					data-dojo-props='src:"../../images/dish1.jpg", value:"dish1", headerText:"dish1"'></div>
				<div data-dojo-type="dojox/mobile/CarouselItem"
					data-dojo-props='src:"../../images/dish2.jpg", value:"dish2", headerText:"dish2"'></div>
			</div>

			<div data-dojo-type="dojox/mobile/SwapView">
				<div data-dojo-type="dojox/mobile/CarouselItem"
					data-dojo-props='src:"../../images/dish3.jpg", value:"dish3", headerText:"dish3"'></div>
				<div data-dojo-type="dojox/mobile/CarouselItem"
					data-dojo-props='src:"../../images/dish4.jpg", value:"dish4", headerText:"dish4"'></div>
			</div>

			<div data-dojo-type="dojox/mobile/SwapView" lazy="true">
				<div data-dojo-type="dojox/mobile/CarouselItem"
					data-dojo-props='src:"../../images/dish5.jpg", value:"dish5", headerText:"dish5"'></div>
				<div data-dojo-type="dojox/mobile/CarouselItem"
					data-dojo-props='src:"../../images/dish6.jpg", value:"dish6", headerText:"dish6"'></div>
			</div>
		</div>
	</div>
</body>
</html>
